package homework.service;

import homework.database.Util;

public class LoginService {
	
	public boolean isLoginSuccess = false;;
	
	public String name = "";
	
	public LoginService(String account, String password) {
		
		Util.query("select * from user where account = ? and password = ?", 
				Util.asSqlArgs(account, password), 
				(resultSet) -> {
					if(resultSet.next()) {
						isLoginSuccess = true;
						name = resultSet.getString("name");
					}
				});		
	}
}
